$OpenBSD: patch-CMakeLists_txt,v 1.10 2017/04/13 09:36:36 sthen Exp $

don't pick up libevent2 from ports, otherwise rspamd links against
both libevent from base *and* libevent2

--- CMakeLists.txt.orig	Fri Apr  7 08:05:52 2017
+++ CMakeLists.txt	Wed Apr 12 19:55:03 2017
@@ -527,14 +527,14 @@ SET(POE_LOOP "Loop::IO_Poll")
 SET(TAR "tar")
 
 # Platform specific configuration
-IF(CMAKE_SYSTEM_NAME MATCHES "^.*BSD$|DragonFly")
+IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD|DragonFly")
 	ADD_DEFINITIONS(-DFREEBSD -D_BSD_SOURCE)
 	CONFIGURE_FILE(freebsd/rspamd.sh.in freebsd/rspamd @ONLY)
 
 	IF(ENABLE_REDIRECTOR MATCHES "ON")
 		CONFIGURE_FILE(freebsd/redirector.sh.in freebsd/redirector @ONLY)
 	ENDIF(ENABLE_REDIRECTOR MATCHES "ON")
-	MESSAGE(STATUS "Configuring for BSD system")
+	MESSAGE(STATUS "Configuring for FreeBSD/DragonFly system")
 	# Find util library
 	ProcessPackage(LIBUTIL LIBRARY util INCLUDE libutil.h
 		ROOT ${LIBUTIL_ROOT_DIR} OPTIONAL)
@@ -547,8 +547,14 @@ IF(CMAKE_SYSTEM_NAME MATCHES "^.*BSD$|DragonFly")
 	ENDIF()
 	SET(POE_LOOP "Loop::Kqueue")
 	SET(TAR "gtar")
-ENDIF()
+ENDIF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD|DragonFly")
 
+IF(CMAKE_SYSTEM_NAME MATCHES "NetBSD|OpenBSD")
+	MESSAGE(STATUS "Configuring for NetBSD/OpenBSD")
+	SET(POE_LOOP "Loop::Kqueue")
+	SET(TAR "gtar")
+ENDIF(CMAKE_SYSTEM_NAME MATCHES "NetBSD|OpenBSD")
+
 IF(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
 	SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_BSD_SOURCE -DDARWIN")
 	SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS} -undefined dynamic_lookup")
@@ -683,7 +689,7 @@ ELSE()
 ENDIF()
 
 ProcessPackage(LIBEVENT LIBRARY event INCLUDE event.h INCLUDE_SUFFIXES include/event
-	ROOT ${LIBEVENT_ROOT_DIR} MODULES event libevent)
+	ROOT ${LIBEVENT_ROOT_DIR} MODULES event)
 ProcessPackage(SQLITE3 LIBRARY sqlite3 INCLUDE sqlite3.h INCLUDE_SUFFIXES include/sqlite3 include/sqlite
 	ROOT ${SQLITE3_ROOT_DIR} MODULES sqlite3 sqlite)
 ProcessPackage(ICUDATA LIBRARY icudata INCLUDE ucnv.h INCLUDE_SUFFIXES include/unicode
